window.onload = function() {
    // 退出账号
    var quit = document.getElementById("quit")
    quit.onclick = function() {
        var s = confirm('您确定要退出该账号吗?')
        if (s == true) {
            window.location.href = "z-login.html"
        }
    }

    //判断手机号
    var xg = document.getElementById('xg')
    var tel = document.getElementById('tel')
    var telt = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
    xg.onclick = function() {
        var psd = prompt('请输入您的手机号')
        if (telt.test(psd)) {
            tel.innerHTML = psd
            alert('修改成功')
        } else {
            alert('请输入正确的手机号')
        }
        return psd
    }
    var exit = document.getElementById('exit')
    exit.onclick = function() {
        if (confirm('您确定要退出吗?')) {
            localStorage.removeItem("************")
            window.location.href = 'z-login.html'

        }
    }

    //性别选择
    //$("#boy").attr("checked","checked"); 选中性别
    var male = document.getElementById('boy')
    var female = document.getElementById('girl')
    male.onmousedown = function() {
        $("#boy").attr("checked", "checked")
        alert('您的性别修改为了男')
    }
    female.onmousedown = function() {
        $("#girl").attr("checked", "checked")
        alert('您的性别修改为了女')
    }

}